import 'package:flutter_mvvm_demo/page/home/model/home_product_model.dart';

class HomeService {
  /// 首页请求数据
  static Future<List<HomeProductModel>> getHomeList() async {
    List<HomeProductModel> _dataList = [];
    await Future.delayed(const Duration(milliseconds: 2000), () {
      for (int i = 0; i < 20; i++) {
        Map<String, dynamic> data = {
          'name': "商品----$i",
          'num': i,
          'price': 10.0 * i,
          'img': '',
        };
        _dataList.add(HomeProductModel.fromJson(data));
      }
    });
    return _dataList;
  }
}
